package myky.com.doctorapp.model;

import com.xiangyao.train.utils.RxScedulerHelper;

import io.reactivex.Observable;
import myky.com.doctorapp.api.ApiManager;
import myky.com.doctorapp.base.BaseEntity;
import myky.com.doctorapp.contract.ChooseDissesTypeContract;
import myky.com.doctorapp.entity.ChooseDisesTypeEntity;
import myky.com.doctorapp.utils.RequestBodyBuilder;
import okhttp3.RequestBody;

public class ChooseDissesTypeModel implements ChooseDissesTypeContract.Model {
    @Override
    public Observable<BaseEntity<ChooseDisesTypeEntity>> findDissesType(String currentPage, String selectid, String selecttype, String pageSize, String version) {

        RequestBodyBuilder.Builder builder=new RequestBodyBuilder.Builder();

        RequestBody requestBody = builder.params("current", currentPage)
                .params("selectid", selectid)
                .params("selecttype", selecttype)
                .params("size", pageSize)
                .params("version", version)
                .build();


        return ApiManager.getApistore().findDisesType(requestBody).compose(RxScedulerHelper.INSTANCE.io_main());
    }
}
